<template>
  <a-drawer
    width="576"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{height:'calc(100vh - 100px)',overflow:'auto'}"
    @close="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="24" >
            <a-form-model-item label="供应商类别" prop="supplierCategory">
              <a-select
                placeholder="请选择供应商类别"
                v-model="form.supplierCategory"
                :getPopupContainer="
                  triggerNode => {
                    return triggerNode.parentNode || document.body
                  }
                "
                style="width: 100%"
                allow-clear>
                <a-select-option v-for="(d, index) in supplierCategoryOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="供应商编码" prop="supplierCode">
              <a-input v-model="form.supplierCode" placeholder="请输入供应商编码"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="供应商名称" prop="supplierName">
              <a-input v-model="form.supplierName" placeholder="请输入供应商名称"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="助记码">
              <a-input v-model="form.mnemonicCode" placeholder="请输入助记码"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="联系电话" prop="phone">
              <a-input v-model="form.phone" placeholder="请输入联系电话"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="联系人" prop="contactPerson">
              <a-input v-model="form.contactPerson" placeholder="请输入联系人"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="描述" prop="remark">
              <a-input v-model="form.remark" placeholder="请输入描述"/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button :disabled="disabled" @click="cancel">
            取消
          </a-button>
          <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
            保存
          </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BizSupplierEditForm from './BizSupplierForm'
export default {
  ...BizSupplierEditForm
}
</script>
